package com.myown.dto.json;

import com.myown.exception.enums.ExpectionEnum;

/**
 * 前后台传值状态码模板 <p>
 * @author lincky
 * @version v1.0.0
 */
public class StatusModel {

    // 状态码
    private Integer code;

    private String message;

    private String extralMessage;

    /**
     * 警告：使用无参构造方法，务必置属性 <p>
     */
    public StatusModel() {
    }
    public StatusModel(ExpectionEnum expectionEnum) {
        this.code = expectionEnum.getCode();
        this.message = expectionEnum.getMessage();
    }

    public StatusModel(ExpectionEnum expectionEnum, String extralMessage) {
        this.code = expectionEnum.getCode();
        this.message = expectionEnum.getMessage();
        this.extralMessage = extralMessage;
    }

    public StatusModel(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public StatusModel(Integer code, String message, String extralMessage) {
        this.code = code;
        this.message = message;
        this.extralMessage = extralMessage;
    }

    @Override
    public String toString() {
        return "ExceptionModel{" +
                ", code=" + code +
                ", message='" + message + '\'' +
                ", extralMessage='" + extralMessage + '\'' +
                '}';
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getExtralMessage() {
        return extralMessage;
    }

    public void setExtralMessage(String extralMessage) {
        this.extralMessage = extralMessage;
    }
}
